using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class BoundarySettingPanel : MonoBehaviour
{
    [Tooltip("自由流动边界")]
    [SerializeField] private Toggle outflowToggle;
    [Tooltip("对称边界")]
    [SerializeField] private Toggle axi_symmetricToggle;
    [Tooltip("镜面反射边界")]
    [SerializeField] private Toggle specularReflectionToggle;
    [Tooltip("面边界")]
    [SerializeField] private Toggle treatBoundaryToggle;
    
    [SerializeField] private ToggleGroup toggleGroup;
    // Start is called before the first frame update
    // void Start()
    // {
    //     GetToggleName();
    // }

    /// <summary>
    /// 获取当前选中的边界类型
    /// </summary>
    /// <returns></returns>
    public string GetToggleName()
    {
        // foreach (var toggle in toggleGroup.ActiveToggles())
        // {
        //     if (toggle.isOn)
        //     {
        //        string[] name = toggle.name.Split('_');
        //        Debug.Log(name[name.Length - 1]);
        //         return name[name.Length - 1];
        //     }
        // }
        if(outflowToggle.isOn)
            return "o";
        if(axi_symmetricToggle.isOn)
            return "a";
        if (specularReflectionToggle.isOn)
            return "s";
        if (treatBoundaryToggle.isOn)
            return "t";
        return null;
    }
    // Update is called once per frame
    // void Update()
    // {
    //     if (Input.GetMouseButtonDown(1))
    //     {
    //         GetToggleName();
    //     }
    // }
}
